""" 
    Adds PropertyManager support to PythonScript objects
    
    Needed for SkinChooser editlets to be able to see pythonscripts
"""
    

from Products.PythonScripts.PythonScript import PythonScript
from OFS.PropertyManager import PropertyManager

for name, attribute in PropertyManager.__dict__.items():
    if name.startswith( "__" ): continue    
    if callable( attribute ):        
        setattr( PythonScript, name, attribute )
    

PythonScript._properties=({'id':'title', 'type': 'string', 'mode':'wd'},)

PythonScript.manage_options += PropertyManager.manage_options

print "Patched python scripts"